package com.ruoyi.marketing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.marketing.mapper.MarketingMapper;
import com.ruoyi.marketing.domain.Marketing;
import com.ruoyi.marketing.service.IMarketingService;

/**
 * 商品营销Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-02-26
 */
@Service
public class MarketingServiceImpl implements IMarketingService 
{
    @Autowired
    private MarketingMapper marketingMapper;

    /**
     * 查询商品营销
     * 
     * @param methodsId 商品营销主键
     * @return 商品营销
     */
    @Override
    public Marketing selectMarketingByMethodsId(Long methodsId)
    {
        return marketingMapper.selectMarketingByMethodsId(methodsId);
    }

    /**
     * 查询商品营销列表
     * 
     * @param marketing 商品营销
     * @return 商品营销
     */
    @Override
    public List<Marketing> selectMarketingList(Marketing marketing)
    {
        return marketingMapper.selectMarketingList(marketing);
    }

    /**
     * 新增商品营销
     * 
     * @param marketing 商品营销
     * @return 结果
     */
    @Override
    public int insertMarketing(Marketing marketing)
    {
        marketing.setCreateTime(DateUtils.getNowDate());
        return marketingMapper.insertMarketing(marketing);
    }

    /**
     * 修改商品营销
     * 
     * @param marketing 商品营销
     * @return 结果
     */
    @Override
    public int updateMarketing(Marketing marketing)
    {
        marketing.setUpdateTime(DateUtils.getNowDate());
        return marketingMapper.updateMarketing(marketing);
    }

    /**
     * 批量删除商品营销
     * 
     * @param methodsIds 需要删除的商品营销主键
     * @return 结果
     */
    @Override
    public int deleteMarketingByMethodsIds(Long[] methodsIds)
    {
        return marketingMapper.deleteMarketingByMethodsIds(methodsIds);
    }

    /**
     * 删除商品营销信息
     * 
     * @param methodsId 商品营销主键
     * @return 结果
     */
    @Override
    public int deleteMarketingByMethodsId(Long methodsId)
    {
        return marketingMapper.deleteMarketingByMethodsId(methodsId);
    }
}
